﻿using BW.IBLL;
using BW.Model;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BW.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class fenleiController : ControllerBase
    {
        public fenleiController(IfenleiBLL bll,ILogger<fenleiController> logger)
        {
            Bll = bll;
            Logger = logger;
        }

        public IfenleiBLL Bll { get; }
        public ILogger<fenleiController> Logger { get; }
        /// <summary>
        /// 绑定
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public List<fenleiModel> bang()
        {
            try
            {
                Logger.LogInformation("分类绑定成功");
                return Bll.bang();
            }
            catch (Exception)
            {
                Logger.LogInformation("分类绑定失败");
                throw;
            }
        }
    }
}
